﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LitTools
{
    /// <summary>
    /// 数值单位
    /// </summary>
    public partial class NumberUtility
    {
        public static string GetUnit(List<Unit> unitList, float num)
        {
            for (int i = 0; i < unitList.Count; i++)
            {
                var unit = unitList[i];
                if (num / Mathf.Pow(10, unit.limitCount) >= 1)
                {
                    return unitList[i].symbol;
                }
            }
            return "";
        }
    }
    public struct Unit
    {
        public int limitCount;
        public int zeroCount;
        public string symbol;
    }
}